The present invention relates to the field of computer programming in general and more particularly to terminal emulation.
It is known to use script languages, such as Extensible Markup Language (XML), to provide terminal emulation for legacy host based applications and the data provided by the applications. For example, data provided by host applications traditionally accessed using 3270 terminal emulation may be reformatted using XML, which can enable the data and application to be accessed via a World Wide Web (WWW) browser rather than a video terminal.
Moreover, the reformatted data can be presented to the end user in a variety of styles by applying respective mappings to the reformatted data from the host application, such as those written in Extensible Stylesheet Language (XSL). For example, a host application that presents 10 items on a screen where each item has 2 associated fields can be reformatted and presented to the user as a table of 2 rows and 10 columns by applying a first style or as a bulleted list of 20 items by applying a second style. Both styles may be desirable because some users may wish to see the data in the first style while other users wish to see the data in the second style.
It may be difficult and time consuming to develop all of the different presentation styles desired by different users of the data. In particular, some conventional systems may store a predetermined reformatted screen for each presentation style desired of the screens provided by the host application. For example, if two presentation styles are desired for a host application which provides a total of six screens of data, a conventional system may provide all of the desired styles by previously generating and storing twelve reformatted screens: two presentation styles for each of the six screens of data generated by the host. At run time, the system searches a database to determine which of the host screens is displayed and matches the previously generated reformatted screen that corresponds to the host screen which is then displayed.
Unfortunately, the time to generate the reformatted screens for all of the presentation styles desired by the users can increase the development time and cost of such systems. Such systems can also create a burdensome amount of computational overhead at run-time, therefore, leading to poor system performance. Furthermore, if the screen format of the data provided by the host application changes, the previously generated reformatted screens may not function properly. Software may be provided to automatically extract the data and present it in the desired style, however, specific knowledge of the host application may be needed to develop such software. Consequently, there is a need for improved generation of reformatted screens for legacy host applications
It is an object of the present invention to allow improved terminal emulation for legacy host systems.
It is another object to allow improvement in the development of terminal emulation for legacy host systems.
These and other objects can be provided by methods, systems, and computer program products that reformat a host screen generated by an application that includes components thereon. The reformatted screen is generated automatically by arranging selected components from the host screen according to one of a plurality of predetermined styles, wherein the components are selected from the host screen upon determining that an organization of the components on the host screen matches a layout of the reformatted screen associated with one of the plurality of the predetermined styles.
Accordingly, the present invention can allow a reduction in the amount of manual interaction by the user. In particular, the host screen is reformatted based on the layout. The layout specifies the components which will be extracted from the host screen and displayed according to the predetermined style.
According to another aspect of the present invention, the layout specifies a spatial arrangement for the components selected from the host screen. A first data structure is generated that describes the organization for components selected from the host screen on the reformatted screen. The organization of the components on the host screen is compared to the organization of the layout. The components are selected from the host screen which match the organization of the layout.
In still another aspect of the present invention, the comparison is performed by determining starting and ending positions of sequentially ordered components on the host screen and comparing the respective starting and ending positions of the sequentially ordered components on the host screen. The organization of the components on the host screen is determined based on the comparison of the respective starting and ending positions of the sequentially ordered components on the host screen.
In a further aspect of the present invention, a second data structure is generated by including the selected components from the host screen in the first data structure and the reformatted display is generated based on the second data structure.
In yet another aspect of the present invention, a second reformatted screen is generated when the layout of the reformatted screen associated with one of the plurality of the predetermined styles is changed.